package cn.kgb.dao;

import cn.kgb.javabean.WeatherReportServiceLog;
import cn.kgb.util.DataAccess;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class WeatherReportServiceLogDAO
{
  public void InsertWeatherReportServiceLog(WeatherReportServiceLog log)
  {
    Connection con = DataAccess.getConnection();

    String sql = "INSERT INTO myjavamail_sms_log VALUES (NULL,'" + log.getType() + "','" + log.getUsername() + 
      "','" + log.getPhonenumber() + "','" + log.getEmail() + "','" + log.getContent() + "','" + log.getState() + 
      "','" + log.getDate() + "')";
    System.out.println("sql:" + sql);
    Statement stmt = null;
    try {
      stmt = con.createStatement();
      stmt.executeUpdate(sql);
      stmt.close();
      con.close();
    }
    catch (SQLException e) {
      e.printStackTrace();
    }
    finally {
      if (stmt != null) {
        try {
          stmt.close();
        } catch (Exception localException2) {
        }
        stmt = null;
      }
      if (con != null) {
        try {
          con.close();
        } catch (Exception localException3) {
        }
        con = null;
      }
    }
  }
}